package com.ruoyi.qsng.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.uuid.SnowFlakeUtil;
import com.ruoyi.qsng.domain.KTalentRecruitment;
import com.ruoyi.qsng.mapper.KTalentRecruitmentMapper;
import com.ruoyi.qsng.service.IKTalentRecruitmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 人才招聘Service业务层处理
 *
 * @author kanglou
 * @date 2023-06-07
 */
@Service
public class KTalentRecruitmentServiceImpl implements IKTalentRecruitmentService {
    @Autowired
    private KTalentRecruitmentMapper kTalentRecruitmentMapper;

    /**
     * 查询人才招聘
     *
     * @param id 人才招聘主键
     * @return 人才招聘
     */
    @Override
    public KTalentRecruitment selectKTalentRecruitmentById(String id) {
        return kTalentRecruitmentMapper.selectKTalentRecruitmentById(id);
    }

    /**
     * 查询人才招聘列表
     *
     * @param kTalentRecruitment 人才招聘
     * @return 人才招聘
     */
    @Override
    public List<KTalentRecruitment> selectKTalentRecruitmentList(KTalentRecruitment kTalentRecruitment) {
        return kTalentRecruitmentMapper.selectKTalentRecruitmentList(kTalentRecruitment);
    }

    /**
     * 新增人才招聘
     *
     * @param kTalentRecruitment 人才招聘
     * @return 结果
     */
    @Override
    public int insertKTalentRecruitment(KTalentRecruitment kTalentRecruitment) {
        kTalentRecruitment.setId(SnowFlakeUtil.getNextId());
//        kTalentRecruitment.setCreateTime(DateUtils.getNowDate());
        return kTalentRecruitmentMapper.insertKTalentRecruitment(kTalentRecruitment);
    }

    /**
     * 修改人才招聘
     *
     * @param kTalentRecruitment 人才招聘
     * @return 结果
     */
    @Override
    public int updateKTalentRecruitment(KTalentRecruitment kTalentRecruitment) {
        kTalentRecruitment.setUpdateTime(DateUtils.getNowDate());
        return kTalentRecruitmentMapper.updateKTalentRecruitment(kTalentRecruitment);
    }

    /**
     * 批量删除人才招聘
     *
     * @param ids 需要删除的人才招聘主键
     * @return 结果
     */
    @Override
    public int deleteKTalentRecruitmentByIds(String[] ids) {
        return kTalentRecruitmentMapper.deleteKTalentRecruitmentByIds(ids);
    }

    /**
     * 删除人才招聘信息
     *
     * @param id 人才招聘主键
     * @return 结果
     */
    @Override
    public int deleteKTalentRecruitmentById(String id) {
        return kTalentRecruitmentMapper.deleteKTalentRecruitmentById(id);
    }
}
